import { AntdModalProps } from '@/hooks/useAntdModal';
import { saveMapping, saveNotice } from '@/service/globalSetting';
import { Checkbox, Divider, Form, Input, Modal, Radio, Select } from 'antd';
import React from 'react';

const SaveMapping = ({ form, modalProps,closeModal,refresh, }: AntdModalProps) => {
  const onOk = async () => {
    let data = await form.validateFields()
   
   await saveMapping(data)
   closeModal();
   refresh()
  }
  return (<Modal width={800} title="账号类型" {...modalProps} onOk={onOk}>
    <Form form={form} labelCol={{ span: 4 }}
      initialValues={{
        authMode: 'account'
      }}
    >
      <Form.Item hidden name='id'>
        <Input />
      </Form.Item>
      
      <Form.Item label="类型" name='type' rules={[{
        required: true,
        message: '类型'
      }]}>
        <Select placeholder="请选择" options={[{
          value: 'codeup',
          label: '云效用户映射'
        }]} />
      </Form.Item>
     
      <Form.Item label="原值" name='originalValue' rules={[{
        required: true,
        message: '原值'
      }]}>
        <Input placeholder='原值' />
      </Form.Item>
      <Form.Item label="映射值" name='mappingValue' rules={[{
        required: true,
        message: '映射值'
      }]}>
        <Input placeholder='映射值' />
      </Form.Item>
      <Form.Item label="备注" name='remark' rules={[{
        required: true,
        message: '备注'
      }]}>
        <Input placeholder='备注' />
      </Form.Item>
    </Form>
  </Modal>)
}
export default SaveMapping